epoch = datenum(1970,1,1);

while(1)
	try, load 'data.log', catch exception, continue, end

	t = data(:,1)/24/60/60+epoch;
	T0 = -40.1 + 0.01*data(:,2);
	T1 = -40.1 + 0.01*data(:,3);
	T2 = data(:,4)/16.0;
	T3 = data(:,5)/16.0;
	RH0 = -2.0468 + 0.0367*data(:,6) + -1.5955e-6*(data(:,6).^2);
	RH1 = -2.0468 + 0.0367*data(:,7) + -1.5955e-6*(data(:,7).^2);

	figure(1)
	subplot(2,1,1), plot(t, T0), ylabel 'T_0', dateaxis('x',15)
	subplot(2,1,2), plot(t, RH0), ylabel 'RH_0', dateaxis('x',15)

	figure(2)
	subplot(2,1,1), plot(t, T1), ylabel 'T_1', dateaxis('x',15)
	subplot(2,1,2), plot(t, RH1), ylabel 'RH_1', dateaxis('x',15)

	figure(3)
	subplot(2,1,1), plot(t, T2), ylabel 'T_2', dateaxis('x',15)
	subplot(2,1,2), plot(t, T3), ylabel 'T_3', dateaxis('x',15)

	figure(4)
	plot(t, smooth(abs(T2-T3),10)); ylabel '\Delta T', dateaxis('x',15)

	pause(10);
end
